home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / docs / lwml9502.lha / Lightwave-Feb95 / 000461_owner-lightwave-l _Fri Feb 24 08:43:17 1995.msg < prev    next >
Internet Message Format  |  1995-03-19  |  11KB

  1. Return-Path: <owner-lightwave-l>
  2. Received: by netcom22.netcom.com (8.6.9/Netcom)
  3.     id HAA16258; Fri, 24 Feb 1995 07:56:28 -0800
  4. Received: from zevs.ifi.unit.no by netcom22.netcom.com (8.6.9/Netcom)
  5.     id HAA16177; Fri, 24 Feb 1995 07:55:43 -0800
  6. Received: from uranus.ifi.unit.no by zevs.ifi.unit.no with SMTP id AA04464
  7.   (5.67b/IDA-1.4.4 for <lightwave-l@netcom.com>); Fri, 24 Feb 1995 16:55:52 +0100
  8. Received: by uranus.ifi.unit.no (4.1/Uninett-C-1.4)
  9.     id AA05837; Fri, 24 Feb 95 16:55:51 +0100
  10. Date: Fri, 24 Feb 1995 16:55:50 +0100 (MET)
  11. From: Ole Andre Schistad <Ole.Andre.Schistad@ifi.unit.no>
  12. To: lightwave-l@netcom.com
  13. Subject: LW4.0 and physics , an open letter to NewTek
  14. In-Reply-To: <Pine.SUN.3.91.950223224922.28281H@gaspra.pd.com>
  15. Message-Id: <Pine.SUN.3.91.950224165325.5797A-100000@uranus.ifi.unit.no>
  16. Mime-Version: 1.0
  17. Content-Type: TEXT/PLAIN; charset=US-ASCII
  18. Sender: owner-lightwave-l@netcom.com
  19. Precedence: bulk
  20.  
  21.   The word on the grapevine is that the people at NewTek are open for 
  22. suggestions for LW4.0 , and that they read this list. In the hope of seeing
  23. at least some of the features I will mention here , I will try to throw all
  24. the suggestions I've been sitting with at you people :)
  25.  
  26.   I think everyone who use LW and/or the toaster will agree that there's really
  27. just one or two major features that are lacking ; namely procedural textures
  28. and some kind of kinematics. The former , I believe , will be achieved 
  29. through plug-in modules. (God , I hate that word , it's been a catch-phrase
  30. on everyone's lips ever since it became publicly known that LW4.0 would have
  31. them :-/ ). The latter , however , deserves integration into the main 
  32. interface. Now , before you all go ``Who needs all that fancy physics stuff 
  33. in LW anyway ? That's real3d V2 territory , and you know it!'' I want you 
  34. to consider just what the lack of physics of any kind means.
  35.  
  36.   The human being has an amazing ability to do trajectory calculations by
  37. intuition .This is no wonder , as we've been throwing things around for 
  38. thousands of years. When you pick up a stone and throw it at a lightpost ,
  39. you never consider gravity and weight consciously, and yet you still hit it. 
  40. A good pitcher can place a throw within an inch from where he's aiming,
  41. and even more amazingly , a good batter actually HITS that screaming 70+ mps
  42. blur of motion. Tough shit, you say , can I finish my render now please ?
  43.  
  44.   So what IS that animation anyway ? Is it a work of art , or just an attempt
  45. to recreate a small piece of reality ? I believe it's both. More than
  46. anything , though , we are making ILLUSIONS.. and as any good magician 
  47. could tell you , an illusion must be credible to work. But if your objects 
  48. are doing things that simply aren't possible in our world, the watcher 
  49. balks.. the illusion is broken and (s)he realizes that it was all just 
  50. special effects .. make believe .. lies. A good animator avoids that 
  51. pitfall, but it almost always takes a lot of tweaking. I'm sure you know
  52. the feeling .. ``How DOES it move anyway ? THAT sure as hell didn't look 
  53. right!'' . 
  54.  
  55.   Which brings me back to the central issue : An intuitive and easy way to
  56. animate the way nature does. This is also where I will start getting 
  57. technical so please bear with me.
  58.  
  59.   The first thing I learned as a physics student was simplification. By
  60. themselves , the rules that govern our universe are so complex that a mere
  61. human could not hope to take them all into consideration.. even newtonian
  62. physics is enough to drive you out of your mind if you have to consider 
  63. all the equations at once. What you do instead is to look at the cases 
  64. separately , and as simplified as you can possibly get them. It all boils 
  65. down to a set of forces that act upon an object (or body) . Each of those 
  66. forces act in ONE direction each . When you know all the forces that act 
  67. on a body , you can further narrow everything down to one single force acting
  68. upon your object ; a force whose value and direction can be regarded as a 
  69. vector.
  70.  
  71.   To illustrate my point , let's say you have two planets orbiting the sun.
  72. You know that all of those three bodies affect each other with a 
  73. gravitational force that's inversely proportional to their relative distance
  74. from each other (F = gamma * Mm/dd , where gamma is the gravitational 
  75. constant ) . In addition , you have the force that keeps the planets from
  76. falling into the sun ; this is the (rather incorrectly named) centrifugal
  77. force ( F = vv/d ; velocity by the power of two , divided by distance)
  78. So you have four vectors that apply to each of your planets ; current
  79. movement (that is , speed and direction) , gravity from the sun , gravity
  80. from your other planet , and inertia (centrifugal force). 
  81.                       4
  82.                      '`  planet
  83.   ___                || /
  84.  /   \               ||/
  85. | sun |       1 <====()====>2
  86.  \___/               ||
  87.                      `'
  88.                       3
  89.  
  90.  
  91.  
  92.  
  93.  
  94.                      ()-- Planet 2
  95.  
  96.  
  97. Okay , so let's consider the equation in two dimentions ..
  98. You have the vector-set [-3,0] , [3,0] , [0,-1] and [0,25] (vector 4 is the 
  99. planets speed , which is not a force.) You want those three forces 
  100. simplified into one , so you add them together :
  101.  
  102. [-3+3+0 , 0+0-1] = [0,-1] ; voila! you have your single vector that sums
  103.                             up all the forces acting on the planet . 
  104.  
  105.  
  106.   Now let's go one step further ; suppose we know that force .. how does it
  107. affect our object ? All objects have a mass , or more generally , a mass 
  108. distribution . Actually , mass is never distributed uniformly , but 
  109. rather as a random variation in density that usually sticks close enough
  110. to a normalized `mass-per-volume' that we can regard it as uniform.
  111.  
  112.   The beauty of it all though is that for all practical purposes
  113. you can regard that mass as centered at one point; the center of mass. 
  114. And when you know an objects center of mass , you can very easily calculate
  115. how an object is affected by a given force , *including its rotation* !
  116.  
  117.   Attracting and repulsing forces act on the center of mass directly , and 
  118. generate a change in direction and speed . Things get slightly more 
  119. complicated when you're dealing with collisions , because the forces 
  120. involved no longer act on the center directly ; they act where two bodies
  121. intersect. (No pun intended , a body is per definition an object that has 
  122. mass and size larger than zero :-)) . The big secret is ; where did the 
  123. bodies intersect ? When you know that , you're home free - almost.
  124.   
  125.  
  126. __________________________  This is how it looks when you consider just
  127. |                        |  one of the bodies ; X marks the center of mass,
  128. |            X           |  and I is the force that's affecting it. 
  129. |                        |  
  130. |________________________|<====
  131.                              I
  132.  
  133.  
  134. (What I've tried to draw here is an off-center impulse)
  135.  
  136. In order to calculate the change in rotation and velocity , you draw
  137. a line from X to the intersection point. From there you can regard that 
  138. line as the weight arb by which the impacting body applies force. 
  139. I would give the equations , only it's been three years since I left 
  140. my physics studies , and the only physics book I was able to dig up was 
  141. modern physics (no need to get Eisteinian yet :-) - rather embarrassing
  142. really :( . The calculations should take FAR less than a second on any
  143. machine quipped with an FPU. 
  144.  
  145.   So far so good. None of this should be new to Allen and the other people 
  146. at NewTek. The big question is that of the implementation , and I tell 
  147. thee straight ; stick that center of mass into your object format , and 
  148. the job is already half done! :) What I have in mind is to keep the heavy
  149. calculations where they belong ; in modeler. Let's presume that the world is
  150. perfect , and that all objects have a uniform distribution . Calculate
  151. the geometric center of an object , and you get the center of mass. 
  152. That's the only really heavy equation you need , the rest can be done almost
  153. real-time in layout. 
  154.  
  155.  
  156.   What we want from a `physics' addition to LW is the POSSIBILITY to add
  157. real-life motion to our objects , not the necessity to take it into 
  158. consideration. This means that there must be a way to turn physics off,
  159. and leave everything in the capable hands of the user.
  160.  
  161.   Also , the concept of `force' does not exist in LW at this point , but 
  162. you can use Newtons 2nd law ( F=ma ) since you always know the velocity of an
  163. object.  What I have in mind is to separate objects into two or three 
  164. cathegories. I believe the best way to handle the concept of force is to let 
  165. all forces originate in objects or null-objects. Once an object is set up as 
  166. an originator of force (Simple button+value in the objects menu)
  167. it can either  default to receiving forces from other objects , or you 
  168. can totally abstract by leaving that too up to the user. All other objects are
  169. unaffected by force , and I don't think I need to explain why.
  170.  
  171.   A more crucial consideration is that of collision detection , as it could 
  172. potentially wreak havoc on layout . Again , I do not think it would be a
  173. good idea that all objects are taken into account when you want to check for
  174. collisions , because when polygon count goes into the thousands it would
  175. take forever if you had to check for collision against all of them. 
  176.  
  177.   The best approach would perhaps be to limit collision detection to  
  178. `physically receptive' objects (that little button in the objects menu  :).
  179. Whenever the user moves a receptor , you check for collision detection 
  180. along the path from the last known position , and if one has occurred you 
  181. can prompt the user with a simple yes/no requester asking wether or not to
  182. calculate new trajectories . This means that while physics are turned on and 
  183. the user is manipulating a `receptive' object , he is giving trajectory 
  184. input , not absolute positions . (`I want this object to move along a path 
  185. that would take it to this point unless it hits something else'). You 
  186. could even keep the physics on a frame-by-frame basis and keep velocity 
  187. vectors constant after physics are turned off. 
  188.  
  189.   As an alternative to collision detection , you could let the user target
  190. two or more objects together as `physically interactive' . Whenever one 
  191. object is moved , the other connected objects are moved and rotated based
  192. on how their respective centers of mass are located in relation to an
  193. anchor point . I haven't worked out quite how this should work , as
  194. I regard collision detection as instrumental if you want any kind of 
  195. realistic behaviour.
  196.  
  197.  
  198. And that concludes this rather lengthy mail :)
  199.  
  200. - Ole Andre Schistad